<template>
  <van-dialog
    v-model:show="isShow"
    :show-confirm-button="false"
    class="mind-view-dialog"
    :close-on-click-overlay="false"
  >
    <div class="mv_header">
      <div class="close-btn" @click="handleClose">
        <img src="@/assets/conferenceMinutes/close.svg" />
      </div>
    </div>
    <div class="mv_main">
      <MarkmapRender ref="refMarkmap" :content="content" />
    </div>
  </van-dialog>
</template>

<script>
import MarkmapRender from "./MarkmapRender.vue";

export default {
  components: { MarkmapRender },
  props: {
    content: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      isShow: false
    }
  },
  methods: {
    show() {
      this.isShow = true;
      this.$nextTick(() => {
        this.$refs.refMarkmap.getDom();
      });
    },
    handleClose() {
      this.isShow = false;
    }
  }
}
</script>

<style lang="less" scoped>
.mind-view-dialog {
  :deep(.van-dialog) {
    width: 100%;
    height: 100%;
    margin: 0;
    max-width: 100%;
    border-radius: 0;
  }

  .mv_header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    padding: 16px;

    .close-btn {
      cursor: pointer;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: white;
      border-radius: 4px;
      box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);

      img {
        width: 20px;
        height: 20px;
      }
    }
  }

  .mv_main {
    width: 100%;
    height: 100vh;
  }
}
</style> 